package com.irdstudio.efp.edoc.api.rest;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.irdstudio.efp.edoc.service.bo.ImageBizInfoVO;
import com.irdstudio.efp.edoc.service.facade.ImageBizInfoService;
import com.irdstudio.basic.framework.core.constant.ResponseData;
import com.irdstudio.basic.framework.web.controller.AbstractController;

@RestController
@RequestMapping("/api")
public class ImageBizInfoController extends AbstractController {

	@Autowired
	@Qualifier("imageBizInfoService")
	private ImageBizInfoService imageBizInfoService;

	/**
	 * 列表数据查询
	 * 
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/image/biz/infos", method = RequestMethod.POST)
	public @ResponseBody ResponseData<List<ImageBizInfoVO>> queryImageBizInfoAll(@RequestBody ImageBizInfoVO vo) {
		// this.executeQueryList("queryAll", imageBizInfoService, new Object[]{vo});
		List<ImageBizInfoVO> outputVo = imageBizInfoService.queryAllOwner(vo);
		return getResponseData(outputVo);

	}

	/**
	 * 根据主键查询详情
	 * 
	 * @return
	 */
	@RequestMapping(value = "/image/biz/info/{applySeq}", method = RequestMethod.GET)
	public @ResponseBody ResponseData<ImageBizInfoVO> queryByPk(@PathVariable("applySeq") String applySeq) {
		ImageBizInfoVO inVo = new ImageBizInfoVO();
		inVo.setApplySeq(applySeq);
		ImageBizInfoVO outputVo = imageBizInfoService.queryByPk(inVo);
		return getResponseData(outputVo);

	}

	/**
	 * 根据主键删除信息
	 * 
	 * @param imageBizInfo
	 * @return
	 */
	@RequestMapping(value = "/image/biz/info", method = RequestMethod.DELETE)
	public @ResponseBody ResponseData<Integer> deleteByPk(@RequestBody ImageBizInfoVO inImageBizInfoVo) {
		int outputVo = imageBizInfoService.deleteByPk(inImageBizInfoVo);
		return getResponseData(outputVo);

	}

	/**
	 * 根据主键更新信息
	 * 
	 * @param inImageBizInfoVo
	 * @return
	 */
	@RequestMapping(value = "/image/biz/info", method = RequestMethod.PUT)
	public @ResponseBody ResponseData<Integer> updateByPk(@RequestBody ImageBizInfoVO inImageBizInfoVo) {
		int outputVo = imageBizInfoService.updateByPk(inImageBizInfoVo);
		return getResponseData(outputVo);

	}

	/**
	 * 新增数据
	 * 
	 * @param inImageBizInfoVo
	 * @return
	 */
	@RequestMapping(value = "/image/biz/info", method = RequestMethod.POST)
	public @ResponseBody ResponseData<Integer> insertImageBizInfo(@RequestBody ImageBizInfoVO inImageBizInfoVo) {
		int outputVo = imageBizInfoService.insertImageBizInfo(inImageBizInfoVo);
		return getResponseData(outputVo);

	}
}
